<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../scripts/jquery-1.11.3.min.js"></script>
    <script src="../../scripts/lib/echarts-2.2.7/esl.js"></script>
    <script src="../../scripts/lib/echarts-2.2.7/echarts.js"></script>
<style>html,body,.chart{height:100%;margin:0;padding:0;}</style>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="chart1" class="chart"></div>
    <!-- ECharts单文件引入 -->


    <script type="text/javascript">
        $(function() {

    // 路径配置
    require.config({
        paths: {
            echarts: '../../scripts/lib/echarts-2.2.7'
        }
    });

    require(
        [
        'echarts',
        'echarts/chart/chord'
            // 'echarts/chart/line' // 使用柱状图就加载bar模块，按需加载
            ],
            function(ec) {
            // 基于准备好的dom，初始化echarts图表
            var myChart = ec.init(document.getElementById('chart1'));
// **begin

option = {
    // title : {
    //     text: '德国队效力联盟',
    //     x:'right',
    //     y:'bottom'
    // },
    tooltip : {
        trigger: 'item',
        formatter: function (params) {
            if (params.indicator2) {    // is edge
                return params.indicator2 + ' ' + params.name + ' ' + params.indicator;
            } else {    // is node
                return params.name
            }
        }
    },
/*    toolbox: {
        show : true,
        feature : {
            restore : {show: true},
            magicType: {show: true, type: ['force', 'chord']},
            saveAsImage : {show: true}
        }
    },*/
    legend: {
        orient : 'vertical',
        x: 'left',
        data:['101入室盗窃案', '213客运站盗窃案', '721诈骗案','927入室盗窃案']
    },
    series : [
    {
        //name: '德国队效力联盟',
        type:'chord',
        sort : 'ascending',
        sortSub : 'descending',
        ribbonType: false,
        radius: '60%',
        itemStyle : {
            normal : {
                label : {
                    rotate : true
                }
            }
        },
        minRadius: 7,
        maxRadius: 20,
            // 使用 nodes links 表达和弦图
            nodes: [
            {name:'张闵晧'},
            {name:'李小军'},
            {name:'张文俊'},
            {name:'李多福'},
            {name:'毛尔聪'},
            {name:'王达成'},
            {name:'黄资中'},
            {name:'李嘉辛'},

            {name:'101入室盗窃案', symbol: 'droplet'},
            {name:'927入室盗窃案', symbol: 'droplet'},
            {name:'213客运站盗窃案', symbol: 'droplet'},
            {name:'721诈骗案', symbol: 'droplet'}
            ],
            links: [
            {source: '101入室盗窃案', target: '张文俊', weight: 1, name: '效力'},
            {source: '101入室盗窃案', target: '李多福', weight: 1, name: '效力'},
            {source: '101入室盗窃案', target: '张闵晧', weight: 1, name: '效力'},

            {source: '213客运站盗窃案', target: '黄资中', weight: 1, name: '效力'},
            {source: '213客运站盗窃案', target: '毛尔聪', weight: 1, name: '效力'},
            {source: '213客运站盗窃案', target: '王达成', weight: 1, name: '效力'},
            {source: '213客运站盗窃案', target: '张闵晧', weight: 1, name: '效力'},

            {source: '927入室盗窃案', target: '张闵晧', weight: 1, name: '效力'},
            {source: '927入室盗窃案', target: '黄资中', weight: 1, name: '效力'},
            {source: '927入室盗窃案', target: '李多福', weight: 1, name: '效力'},
            {source: '927入室盗窃案', target: '李嘉辛', weight: 1, name: '效力'},

            {source: '721诈骗案', target: '张闵晧', weight: 1, name: '效力'},
            {source: '721诈骗案', target: '李多福', weight: 1, name: '效力'},
            {source: '721诈骗案', target: '张文俊', weight: 1, name: '效力'},
            {source: '721诈骗案', target: '王达成', weight: 1, name: '效力'}
            ]
        }
        ]
    };


//end
            // 为echarts对象加载数据
            myChart.setOption(option);
            window.onresize = myChart.resize
        }
        );

})
</script>
</body>
</html>

